package br.infotec.musicaunb.domain;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.search.annotations.DocumentId;
import org.springframework.data.jpa.domain.AbstractPersistable;
/**
 * entidade representando um bloco
 * @author eduardo
 *
 */
@Entity
@Table(name="bloco")
public class Bloco extends AbstractPersistable<Integer> implements AbstraticPojo{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -3366631887645410971L;
	private String nome;
	private List<Sala> salas;
	
	@Override
	@DocumentId
	@GeneratedValue
	@Column(name="id_bloco")
	public Integer getId() {
		return super.getId();
	}
	
	@Column
	public void setNome(String nome) {
		this.nome = nome;
	}
	public String getNome() {
		return nome;
	}
	
	@OneToMany(mappedBy = "bloco")
	public List<Sala> getSalas() {
		return salas;
	}

	public void setSalas(List<Sala> salas) {
		this.salas = salas;
	}
	
	
}
